package httpserver;

import java.io.InputStream;
import java.util.List;
import java.util.Map;

public class HttpRequestImpl implements HttpRequest {
	private final String					method;
	private final String					url;
	private final String					protocol;

	private final Map<String, List<String>>	headers;
	private final InputStream				inputStream;
	private final HttpResponse				response;

	private final String					remoteAddress;
	private final int						port;

	public HttpRequestImpl(String method, String url, String protocol, Map<String, List<String>> headers, InputStream inputStream, HttpResponse response,
			String remoteAddress, int port) {
		super();
		this.method = method;
		this.url = url;
		this.protocol = protocol;
		this.headers = headers;
		this.inputStream = inputStream;
		this.response = response;
		this.remoteAddress = remoteAddress;
		this.port = port;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see httpserver.HttpRequest#getMethod()
	 */
	public String getMethod() {
		return method;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see httpserver.HttpRequest#getUrl()
	 */
	public String getUrl() {
		return url;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see httpserver.HttpRequest#getProtocol()
	 */
	public String getProtocol() {
		return protocol;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see httpserver.HttpRequest#getHeaders()
	 */
	public Map<String, List<String>> getHeaders() {
		return headers;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see httpserver.HttpRequest#getInputStream()
	 */
	public InputStream getInputStream() {
		return inputStream;
	}

	public HttpResponse getResponse() {
		return response;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see httpserver.HttpRequest#getRemoteAddress()
	 */
	public String getRemoteAddress() {
		return remoteAddress;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see httpserver.HttpRequest#getPort()
	 */
	public int getPort() {
		return port;
	}

}
